<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script src="./lodash.min.js"></script>
  <script>
    // 语法：_.cloneDeep(要被克隆的对象)

    const obj = {
      uname: 'cxk',
      age: 18,
      hobby: ['乒乓球', '足球'],
      family: {
        baby: '马嘉祺'
      }
    }
    const o = _.cloneDeep(obj)  // 深克隆
    console.log(o)
    o.family.baby = '蔡徐坤'
    console.log(o)
    console.log(obj)
  </script>
</body>

</html>